package com.edie.customview.data.net.api;

import com.edie.customview.data.entity.UserEntity;
import com.edie.customview.data.net.entity.HttpResponse;
import com.edie.customview.data.net.entity.UserInfoEntity;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * edie create on 2018/7/10
 */
public interface UserApi {

    @FormUrlEncoded
    @POST("login")
    Observable<UserEntity> postLogin(@Field("device") String device,
                                     @Field("deviceid") String deviceid,
                                     @Field("time") String time,
                                     @Field("hash") String hash,
                                     @Field("version") String version,
                                     @Field("miei") String miei,
                                     @Field("model") String model,
                                     @Field("username") String username,
                                     @Field("password") String password);

    @FormUrlEncoded
    @POST("loginerr")
    Observable<UserEntity> postErrorLogin(@Field("device") String device,
                                          @Field("deviceid") String deviceid,
                                          @Field("time") String time,
                                          @Field("hash") String hash,
                                          @Field("version") String version,
                                          @Field("miei") String miei,
                                          @Field("model") String model,
                                          @Field("username") String username,
                                          @Field("password") String password);

    @FormUrlEncoded
    @POST("userinfo")
    Observable<String> loadUserInfo(@Field("device") String device,
                                    @Field("deviceid") String deviceid,
                                    @Field("time") String time,
                                    @Field("hash") String hash,
                                    @Field("version") String version,
                                    @Field("hashid") String hashid,
                                    @Field("uid") String uid);


    @FormUrlEncoded
    @POST("userinfo")
    Observable<String> loadUserInfo(@Field("hashid") String hashid,
                                    @Field("uid") String uid);
    @FormUrlEncoded
    @POST("userinfo")
    Observable<HttpResponse<UserInfoEntity>> loadUserInfoNew(@Field("hashid") String hashid,
                                                             @Field("uid") String uid);
}
